package sg.edu.nus.iss.vmcs.store;

/*
 * Copyright 2003 ISS.
 * The contents contained in this document may not be reproduced in any
 * form or by any means, without the written permission of ISS, other
 * than for the purpose for which it has been supplied.
 *
 */

import java.io.*;

/**
 * This interface defines all the methods required for reading a Store property
 * file
 * 
 * @version 3.0 5/07/2003
 * @author Olivo Miotto, Pang Ping Li
 */
public interface PropertyLoader {

	/**
	 * Initialize the properties by loading the data from CashPropertyFile.txt
	 * and ProductPropertyFile.txt into CashStore and ProductStore respectively
	 * 
	 * @throws IOException
	 *             if either of the file is not found
	 */
	public void initialize() throws IOException;

	/**
	 * Save the updated data from CashStore and ProductStore into
	 * CashPropertyFile.txt and ProductPropertyFile.txt respectively
	 * 
	 * @throws IOException
	 *             if either of the file is not found
	 */
	public void saveProperty() throws IOException;

	/**
	 * get the number of items in the property
	 */
	public int getNumOfItems();

	/**
	 * set the number of items in the property
	 */
	public void setNumOfItems(int numItems);

	/**
	 * Get the StoreItem by passing in the index
	 * 
	 * @param index
	 *            the index of the Storeitem to retrieve
	 */
	public StoreItem getItem(int index);

	/**
	 * Insert the StoreItem into the index passed in
	 * 
	 * @param index
	 *            the index of the StoreItem to be inserted into
	 * @param item
	 *            the item to insert into the Store
	 */
	public void setItem(int index, StoreItem item);

}
